import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("syspay")
class syspay extends BaseService {
	page({ bra_id = [], ...args }) {
		let params = {
			...args,
			bra_id: bra_id.join()
		}
		return this.$get("/lists", { params }).then(res => {
			return {
				list: res,
				pagination: {
					...params,
					total: res.total
				}
			};
		});
	}
	// 新增
	add(params) {
		return this.$post("/add", params);
	}
	edit(params) {
		return this.$post("/edits", params);
	}
	setstatus(params) {
		return this.$post("/setstatus", params);
	}

	// 定金部门支付参数 - 添加
	deptadd({ dept_id = [], ...args }) {
		let params = {
			dept_id: dept_id[1],
			...args
		}
		return this.$post("/deptadd", params);
	}
	// 定金部门支付参数 - 编辑
	deptedits({ dept_id = [], ...args }) {
		let params = {
			dept_id: dept_id[1],
			...args
		}
		return this.$post("/deptedits", params);
	}
	// 定金部门支付参数 - 状态修改
	setdeptstatus(params) {
		return this.$post("/setdeptstatus", params);
	}

	// 定金部门支付参数 - 列表
	deptlists({ dept_id = [], ...args }) {
		let params = {
			...args,
			dept_id: dept_id[1]
		}
		return this.$get("/deptlists", { params }).then(res => {
			return {
				list: res,
				pagination: {
					...params,
					total: res.total
				}
			};
		});
	}

}
export default syspay;
